package gcontent.entities.content.text;

import gcontent.entities.Content;
import gcontent.entities.Site;
import gcontent.entities.content.error.ContentEx;
import gcontent.record.error.RecordEx;

public class ContentText extends Content {
	
	public static final String MIMETYPE_TEXT = "text/plain";
	
	public ContentText()
	{
		super();
	}
	
	public Site getSite()
	{
		return null;
	}
	
	public String getFormat() { return MIMETYPE_TEXT; }
	
	public void save() throws RecordEx, ContentEx
	{		
		this.id = (Integer)this.record.execProc("PROC_CreateContentText", 
				  null,
				  null,								
				  this.body,
				  this.body == null? 0 : this.body.length,
				  this.last_modified,
				  this.truncated
				  );
									  								
	}
}
